package Vista;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaEquipo extends javax.swing.JFrame {
	private JLabel JblCodigo;
	private JLabel JblEntrenador;
	private JLabel LblRegistarEquipo;
	private JButton BttAgregar;
	private JTextField TxtEntrenador;
	private JTextField TxtAFundacion;
	private JTextField TxtPais;
	private JTextField TxtCodigo;
	private JLabel JblAFundacion;
	private JLabel jblPais;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VentanaEquipo inst = new VentanaEquipo();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VentanaEquipo() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				JblCodigo = new JLabel();
				getContentPane().add(JblCodigo);
				JblCodigo.setText("Codigo del equipo:");
				JblCodigo.setBounds(12, 72, 153, 15);
				JblCodigo.setFont(new java.awt.Font("Bitstream Charter",1,14));
			}
			{
				jblPais = new JLabel();
				getContentPane().add(jblPais);
				jblPais.setText("Pais que Representa:");
				jblPais.setBounds(12, 104, 176, 15);
				jblPais.setFont(new java.awt.Font("Bitstream Charter",1,14));
			}
			{
				JblAFundacion = new JLabel();
				getContentPane().add(JblAFundacion);
				JblAFundacion.setText("Año de fundacion de la Federacion de Natacion de Pais:");
				JblAFundacion.setBounds(12, 140, 370, 15);
				JblAFundacion.setFont(new java.awt.Font("Bitstream Charter",1,14));
			}
			{
				JblEntrenador = new JLabel();
				getContentPane().add(JblEntrenador);
				JblEntrenador.setText("Nombre del entrenador del equipo:");
				JblEntrenador.setBounds(12, 174, 310, 15);
				JblEntrenador.setFont(new java.awt.Font("Bitstream Charter",1,14));
			}
			{
				TxtCodigo = new JTextField();
				getContentPane().add(TxtCodigo);
				TxtCodigo.setBounds(382, 69, 101, 22);
			}
			{
				TxtPais = new JTextField();
				getContentPane().add(TxtPais);
				TxtPais.setBounds(382, 101, 102, 22);
			}
			{
				TxtAFundacion = new JTextField();
				getContentPane().add(TxtAFundacion);
				TxtAFundacion.setBounds(381, 137, 102, 22);
			}
			{
				TxtEntrenador = new JTextField();
				getContentPane().add(TxtEntrenador);
				TxtEntrenador.setBounds(357, 171, 132, 22);
			}
			{
				BttAgregar = new JButton();
				getContentPane().add(BttAgregar);
				BttAgregar.setText("Agregar");
				BttAgregar.setBounds(184, 244, 119, 39);
				BttAgregar.setFont(new java.awt.Font("Bitstream Charter",1,22));
			}
			{
				LblRegistarEquipo = new JLabel();
				getContentPane().add(LblRegistarEquipo);
				LblRegistarEquipo.setText("Registrar Equipo");
				LblRegistarEquipo.setBounds(126, 1, 255, 45);
				LblRegistarEquipo.setFont(new java.awt.Font("Century Schoolbook L",1,28));
			}
			pack();
			this.setSize(513, 357);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public String getCodigo(){
		return TxtCodigo.getText();
	}

	public String getPais(){
		return TxtPais.getText();
	}
	
	public String getAFundacion(){
		return TxtAFundacion.getText();
	}
	
	public String getEntrenador(){
		return TxtEntrenador.getText();
	}
	
	
	
	public void agregarListener(ActionListener accion){
		   BttAgregar.addActionListener(accion);
		}
		
	public void mostrarMensaje(String mensaje){
		JOptionPane.showMessageDialog(this, mensaje);
	}
	
	public JButton getBttAgregarEq() {
		return BttAgregar;
	}
	
	public void blanquearCampos(){
		TxtCodigo.setText("");
		TxtPais.setText("");
		TxtAFundacion.setText("");
		TxtEntrenador.setText("");		
	}
	
	
	
	
	
	
	
}
